<!--
* @description 日常巡检
* @author weilu
* @date 2021/03/15 15:26:03
!-->
<template>
    <div class="page" data-page="reportApplyDetail" style="z-index: 2;">
        <div class="page-content" id="vueIframe_content" style="overflow: hidden; height: 100%;">
            <iframe id="vueIframe" src="" style="width: 100%; height: 100%; border: none;"></iframe>
        </div>
    </div>
</template>
<style>
</style>
<script>
    return {
        data: function () {
            return {
                qRcode:''
            }
        },
        methods: {
            showDetail: function(){
                var self = this
                let pageName='InspectMain'
                let tabId=0
                if(['0','1','2'].indexOf(self.tabId.toString())<0){
                    pageName=self.tabId
                    tabId='3'
                }else{
                    tabId=self.tabId
                }
                self.url = `${staticPathVue}#/${pageName}?tabId=${tabId}&item=${self.taskId}&taskId=${self.taskId}&readonly=${self.readonly}&pointCode=${self.pointCode}&compile=1`;
                $("#vueIframe").attr("src", self.url);
                console.log(self.url)
            },
            //原生扫一扫回调
            scanningreciviceLocation: function (qRcode) {
                var self = this;
                self.qRcode = qRcode
                window.parent.document.getElementById('vueIframe').contentWindow.getQode(qRcode)
            },
            onFrameLoad(){
                document.getElementById('vueIframe').onload=()=>{
                    app.methods.backToTab()
                }
            }
        },
        on: {
            pageInit: function () {
                var self = this;
                console.log(staticPathVue)
                self.tabId = self.$route.params.tabId;
                self.taskId = self.$route.params.taskId;
                self.readonly = self.$route.params.readonly||'';
                self.pointCode=self.$route.params.pointCode||'';
                if(native.getDataByKey('IS_OFFLINE_MODULE')=='1'){
                    document.getElementById('vueIframe').onload=self.onFrameLoad
                }
                self.showDetail()
            },
            pageAfterOut: function (e, page) {

            },
        },

    }
</script>